	<?php 
	/**
	 * 个人简历
	 */
	 $sexarr=array(
	 	'0'=>'保密',
		'1'=>'男',
		'2'=>'女',
	 )
	?>
    

	<div class="membersideinfo" id="mb1">
    	<div class="eidt" id="sedit"><a onclick="showedit()" style="opacity: 0.5;">编辑</a></div>
    	<div class="detail">所在城市：<span id="city"><?php echo $memberinfo['city']?></span>年龄：<span id="age"><?php echo $memberinfo['age']?></span>性别：<span id="sex"><?php echo $sexarr[$memberinfo['sex']]?></span></div>
        <div class="detail">职业或者行业：<span id="profession" ><?php echo $memberinfo['profession']?></span></div>
        <div class="detail">联系方式：<span id="contact"><?=$memberinfo['contact']!=''?$memberinfo['contact']:$memberinfo['email']?></span></div>
        <div class="detail"><span >社会荣誉：</span></div>
       <div class="detail">
       		<ul id="honor">
            <?php  $honorarr=explode('，',$memberinfo['honor']);
					foreach($honorarr as $val){
			?>
            	<li><?php echo $val?></li>
             <?php  }?>
            </ul>
       </div>
	</div>
    <div class="membersideinfo2" id="mb2" style="display:none"> <!--隐藏的-->
    	<div class="eidt" ><a onclick="canceledit()"  style="opacity: 0.5;">取消</a><a onclick="saveinfo('<?php echo $memberinfo['mid']?>')"  style="opacity: 0.5;">保存</a></div>
        <form action="" name="form" method="post">
    	<div class="detail">
            所在城市：<span ><input type="text" name="city" value="<?php echo $memberinfo['city']?>"  style="width:30px"/></span>
            年龄：<span><input type="text" name="age" value="<?php echo $memberinfo['age']?>"  style="width:30px"/></span>
            性别：<span >
            <select name="sex" style="width:40px;">
            	<option value="0" <?=$memberinfo['sex']=='0'?'selected':''?>>保密</option>
                <option value="1" <?=$memberinfo['sex']=='1'?'selected':''?>>男</option>
                <option value="2" <?=$memberinfo['sex']=='2'?'selected':''?>>女</option>
            </select></span>
        </div>
        <div class="detail">
        	职业或者行业：<span><input type="text" name="profession" value="<?php echo $memberinfo['profession']?>"  style="width:100px"/></span>
        </div>
        <div class="detail">
        	联系方式：<span ><input type="text" name="contact" value="<?php echo $memberinfo['contact']!=''?$memberinfo['contact']:$memberinfo['email']?>"  style="width:122px"/></span>
        </div>
        <div class="detail"><span >社会荣誉：</span></div>
       <div class="detail">
       		<ul>
            <input type="text" name="honor" value="<?php echo $memberinfo['honor']?>"  style="width:180px"/><span style="color:#CCC">(用逗号隔开)</span>
            </ul>
       </div>
       </form>
	</div>
    <div class="membersideinfo" style="border-bottom:0">
    	<div class="detail " ><span ><b>个人故事</b></span></div>
       <div class="detail editable2" data-id="<?=$memberinfo['mid']?>" data-mode="more" data-field="story" data-info="">
       		<p  class="editcont"><?php echo nl2br($memberinfo['story'])?></p>
       </div>
	</div>
<script type="text/javascript" >
$('.editable2').editAble({action:'<?=site_url('member/savemember')?>'});
function showedit(){
	$("#mb1").hide();
	$("#mb2").show();
}

function canceledit(){
	$("#mb1").show();
	$("#mb2").hide();
}


function saveinfo(id){
	var id=id;
	var city=$('input[name=city]').val();
	var age=$('input[name=age').val();
	var sex=$('select[name=sex]').val();
	var profession=$('input[name=profession]').val();
	var contact=$('input[name=contact]').val();
	var honor=$('input[name=honor]').val();
	 $.post("<?=site_url('member/savemember')?>", {id:id,city:city,age:age,sex:sex,profession:profession,contact:contact,honor:honor,act:'saveinfo'}, function(d){
   			canceledit();
			$('#city').text(city);
			$('#age').text(age);
			var sexname;
			if(sex=='0')sexname='保密';
			if(sex=='1')sexname='男';
			if(sex=='2')sexname='女';
			$('#sex').text(sexname);
			$('#contact').text(contact);
			$('#profession').text(profession);
			var newhonor=honor.replace(/，/gm,"<br>");
			$('#honor').html(newhonor);
			
    });
	  
}

</script>